package yesjava;

public class StrbDemo {
    public static void main(String[] args) {
        String str = new String("中国") + "四川" + "成都" + "成都";//内存是怎么回事？
        System.out.println(str);


        /*String rs = "";
        for (int i = 'A'; i <= 'Z'  ; i++) {
            rs = rs + (char)i;
        }
        System.out.println(rs);*/

       /* StringBuffer strb = new StringBuffer("原来的");
        for (int i = 'A'; i <= 'Z'  ; i++) {
            strb.append((char)i);
        }
        String s = strb.toString();
        System.out.println(s);*/




        StringBuilder strb = new StringBuilder("原来的");
        for (int i = 'A'; i <= 'Z'  ; i++) {
            int a = 8+5;
            strb.append((char)i);
        }
        String s = strb.toString();
        System.out.println(s);
        // 线程安全 和 非线程安全
//        安全 ---》 不安全

        System.out.println(strb.reverse());

        String str11 = "我爱你";
        System.out.println(new StringBuilder(str11).reverse().toString());


    }


}
